home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / demo / medmfc.zip / EDITOR.DOC < prev    next >
Text File  |  1994-08-17  |  28KB  |  850 lines

  1.                    Magma Editor DLL for Microsoft Windows
  2.                    --------------------------------------
  3.  
  4. (C) Copyright 1994 Magma Systems  All Rights Reserved
  5.  
  6. Magma Systems
  7. 15 Bodwell Terrace
  8. Millburn, New Jersey  07041
  9. USA
  10.  
  11. (201) 912-0192  (voice)
  12. (201) 912-0103  (fax)
  13. (201) 912-0668  (BBS, 9600-1200 N-8-1)
  14.  
  15. Compuserve : 75300,2062
  16.              To get to our conference, GO MAGMA
  17.  
  18. Bix        : 'magma'
  19.              To get to our conference, 'join magma'
  20.  
  21. Internet   : 75300.2062@compuserve.com
  22.              magma@bix.com
  23.  
  24.  
  25.  
  26. (The following is rough documentation for the Magma Editor DLL. 
  27. Please send all your comments to Magma Systems)
  28.  
  29.  
  30. Introduction
  31. ------------
  32.  
  33. The Magma Editor DLL is an edit control which provides a powerful
  34. alternative to the standard Microsoft Windows edit control. The
  35. Magma Editor (ME for short) is a line oriented text editing kernel
  36. which can be controlled by an application through a series of
  37. messages or through a high-level C-like macro language. You can
  38. think of the ME DLL as being a "BRIEF in a box".
  39.  
  40. The editor kernel provides the following features and enhancements
  41. over the standard Windows editoc control :
  42.  
  43. - The size of the text is limited by the amount of memory Windows
  44.   can globally allocate. On the other hand, the standard Windows
  45.   edit control is limited to 64K of text.
  46.  
  47. - Regular expression search and substitution
  48.  
  49. - Various block operations. Line marking, column marking, block
  50.   marking, and discontiguous line marking.
  51.  
  52. - Keyboard macros
  53.  
  54. - Messages to read and write to files.
  55.  
  56. - More varieties of cursor movement. Ability to jump to a specific line,
  57.   and to set bookmarks in the text.
  58.  
  59. - The ability to be in overstrike as well as in insert mode.
  60.  
  61.  
  62. Initializing the Editor Class
  63. -----------------------------
  64.  
  65. To access the Magma Edit Control dynamic link library from within your
  66. Windows application, you must make the following call :
  67.  
  68.   if (LoadLibrary("MAGMAED.DLL") < 32)
  69.     return FALSE;
  70.  
  71. The LoadLibrary() function attempts to load the editor DLL, and if it
  72. succeeds, returns a module handle which is greater than or equal to 32.
  73. If a value less than 32 is returned, then the editor DLL could not be loaded.
  74.  
  75. You must make sure that the DLL is either present in your current
  76. working directory, or in a directory which is in your DOS path.
  77.  
  78. The startup routine inside of MAGMAED.DLL registers a global class 
  79. called "MagmaEdit". This is the class name of an editor control.
  80.  
  81.  
  82.  
  83. Creating an Editor Window
  84. -------------------------
  85. Creating an editor window is just like creating any other control window.
  86. You can use a call to the CreateWindow function or, if you use the
  87. editor window as part of a dialog box, you can specify the control
  88. in your RC file.
  89.  
  90. A typical use of the CreateWindow function is as follows:
  91.  
  92. HWND hEdit;
  93. hEdit = CreateWindow("MagmaEdit",
  94.                      NULL,
  95.                      WS_CHILD | WS_VISIBLE | WS_MAXIMIZE,
  96.                      0, 0, 0, 0,
  97.                      hWnd,
  98.                      idCtrl,
  99.                      GetWindowWord(hWnd, GWW_HINSTANCE),
  100.                      (LPSTR) lpFileName);
  101.  
  102. The classname is "MagmaEdit", and it has no initial text. The window
  103. style dictates that it is a visible child window, with 'hWnd' as the parent
  104. window. You may give the editor window a unique control identifier in
  105. order to distinguish it from other controls or editor windows. The size
  106. is 0, 0, 0, 0. Finally, the final argument may be the name of the
  107. file which will be associated with this editor window. If the file already 
  108. exists, then the contents of the file will be read into the editor window.
  109.  
  110.  
  111. Limitations
  112. -----------
  113.  
  114. The Magma Edit control has no size limitations. It can use as much memory
  115. as Windows will globally allocate. The standard Windows edit control can only
  116. use at most 64K of data because it uses LocalAlloc for the edit buffer.
  117.  
  118.  
  119.  
  120.  
  121.                       Message Reference
  122.                       -----------------
  123.  
  124. Below is a list of messages which you can send to an editor window
  125. in order to perform editing operations, cursor movement, or
  126. configuration of the editor. The general form of sending a
  127. message is
  128.  
  129.   result = SendMessage(hWndEdit, ME_xxx, wParam, lParam);
  130.  
  131. Most of the editor commands return TRUE if the command was performed
  132. successfully, and FALSE if the command failed.
  133.  
  134.  
  135. Cursor Movement commands
  136. ------------------------
  137. ME_MOVEUP             Move to the previous line
  138. ME_MOVEDOWN           Move to the next line
  139. ME_MOVELEFT           Move left one character
  140. ME_MOVERIGHT          Move right one character
  141. ME_MOVEBOL            Move to the beginning of the current line
  142. ME_MOVEEOL            Move to the end of the current line
  143. ME_MOVENEXTWORD       Move to the next word
  144. ME_MOVEPREVWORD       Move to the previous word
  145. ME_MOVENEXTPARA       Move to the next paragraph
  146. ME_MOVEPREVPARA       Move to the previous paragraph
  147. ME_MOVETOPOFWINDOW    Move to the upper-left corner of the editing window
  148. ME_MOVEBOTOFWINDOW    Move to the lower-right corner of the editing window
  149. ME_MOVENEXTPAGE       Move to the next page of text
  150. ME_MOVEPREVPAGE       Move to the previous page of text
  151. ME_MOVETOPOFBUFFER    Move to the top of the editing buffer
  152. ME_MOVEBOTOFBUFFER    Move to the last character in the editing buffer
  153. For all of the above commands, wParam and lParam are not used. The
  154. value TRUE is returned if the command was successful, and FALSE is
  155. returned if the command failed.
  156.  
  157. ME_GOTOLINE
  158.   wParam
  159.     GOTOLINE_ABS  - lParam is the absolute line number
  160.     GOTOLINE_NEXT - lParam is the # of lines from the current line
  161.     GOTOLINE_PREV - lParam is the # of lines back from the current line
  162.     GOTOLINE_LAST - go to the last line of the file. lParam is ignored.
  163.   lParam is the line number
  164.  
  165. ME_MATCHBRACE
  166. If the character at the current position is one of the following :
  167.   {, }, (, ), [, ], "
  168. attempts to find the matching brace or quote. If the match is found,
  169. the current position will be moved to the matched character.
  170.   Returns TRUE if successful, FALSE if not.
  171.  
  172.  
  173. Bookmarks
  174. ---------
  175. ME_MOVETOBOOKMARK
  176.   Moves the cursor to a specific bookmarked location.
  177. Parameters
  178.   wParam is the letter of the bookmark
  179.   lParam is not used
  180.  
  181. ME_SETBOOKMARK
  182.   Sets a bookmark at the current cursor position.
  183. Parameters
  184.   wParam is the letter of the bookmark to set
  185.   lParam is not used
  186.  
  187. ME_REMOVEBOOKMARK
  188.   Removes one or more bookmarks from the editing buffer.
  189. Parameters
  190.   wParam is the letter of the bookmark. It can be 'a' through 'z'. If
  191.     wParam is the special value BOOKMARK_REMOVEALL, then all of the
  192.     bookmarks associated with the editing buffer will be removed.
  193.   lParam is not used
  194. Returns
  195.   TRUE
  196.  
  197.  
  198.  
  199. Character Insertion & Deletion
  200. ------------------------------
  201. ME_BACKSPACE
  202.   Backspaces over the previous character and erases it
  203. Parameters
  204.   wParam is not used
  205.   lParam is not used
  206.  
  207. ME_DELCHAR
  208.   Delete the character at the current position. If the character is a newline,
  209.   the the next line will be joined to the current line.
  210. Parameters
  211.   wParam is not used
  212.   lParam is not used
  213.  
  214. ME_DELEOL
  215.   Deletes all characters from the current line starting at the 
  216.   current position and going until the end of the line
  217. Parameters
  218.   wParam is not used
  219.   lParam is not used
  220.  
  221. ME_DELWORD
  222.   Deletes the current word.
  223. Parameters
  224.   wParam is not used
  225.   lParam is not used
  226.  
  227. ME_INSERTCHAR
  228.   Inserts a character at the current position. This function
  229.   obeys the state of the editor's insert/overstrike mode.
  230. Parameters
  231.   wParam is the ASCII character to insert at the current position
  232.   lParam is not used
  233.  
  234.  
  235. ME_INSERTSTRING
  236.   Inserts a string into the editor at the current position.
  237. Parameters
  238.   wParam is ME_OVERSTRIKE_MODE if you want to overstrike the existing
  239.     text at the current position in the buffer. Any other value of 
  240.     wParam will insert the text at the current position in the buffer.
  241.   lParam is a far pointer to the text to insert. The text may have
  242.     embedded tab characters (\t) or newlines (\n).
  243. Returns
  244.   TRUE if the text was inserted, FALSE if not.
  245. Example
  246.   SendMessage(hWndEdit, ME_INSERTSTRING, ME_INSERT_MODE,
  247.               (LONG) (LPSTR) "This is line 1\nAnd this is line 2\n");
  248.  
  249.  
  250. ME_TOGGLEINSERT
  251.   Toggles or sets the state of the insert/overstrike mode
  252. Parameters
  253.   wParam can be
  254.     INSERTMODE_TOGGLE - toggle the state
  255.     INSERTMODE_ON     - sets insert mode
  256.     INSERTMODE_OFF    - sets overstrike mode
  257.   lParam is not used
  258.  
  259. ME_TOGGLEWORDWRAP
  260.   Toggles the current state of the wordwrap flag.
  261. Parameters
  262.   wParam can be
  263.     WORDWRAP_OFF      - turns wordwrap off
  264.     WORDWRAP_ON       - turns wordwrap on
  265.     WORDWRAP_TOGGLE   - toggles wordwrap mode
  266.   lParam is not used.
  267. Returns
  268.   Nothing.
  269.  
  270.  
  271. File I/O
  272. --------
  273. ME_OPENFILE
  274.   Inserts the contents of a file at the current cursor position.
  275. Parameters
  276.   wParam is 0 if lParam points to a valid filename. You can pass
  277.     the handle of an open file in wParam. If you do this, then lParam
  278.     must be 0.
  279.   lParam is a far pointer to the name of the file to read. If lParam
  280.     is 0, then wParam is assumed to contain the handle of an open file.
  281. Returns
  282.   TRUE if successful, FALSE if not.
  283.  
  284. ME_WRITEFILE
  285.   Writes the contents of the editor buffer to a file.
  286. Parameters
  287.   wParam is usually 0. If lParam is NULL, wParam may contain a
  288.     file handle.
  289.   lParam is a far pointer to the name of the file to write to.
  290.   If the lParam is NULL and wParam is 0, then the filename already associated 
  291.   with  the editor window is used. If lParam is NULL and wParam is not zero,
  292.   then wParam is interpeted as a file handle to write to.
  293. Returns
  294.   TRUE if successful, an error code if not. The error code can be
  295.   one of the following values :
  296.     EN_ERRCREATING  could not create the file
  297.     EN_ERRWRITING   could not write out the entire editor buffer to
  298.                     the file.
  299.  
  300.   
  301.  
  302. Search & Substitute commands
  303. ----------------------------
  304. ME_FSEARCH
  305.   Search forward (from the current position) for a pattern.
  306.  
  307. ME_BSEARCH
  308.   Search backwards (from the current position) for a pattern.
  309.  
  310. ME_FREPLACE
  311.   Search forward (from the current position) for a pattern and substitute 
  312.   with a pattern.
  313.  
  314. ME_BREPLACE
  315.   Search backward (from the current position) for a pattern and substitute
  316.   with a pattern.
  317.  
  318. Parameters
  319.   wParam is not used
  320.   lParam :
  321.  
  322.   For the search and substitute commands, the format of the data passed
  323.   into lParam is :
  324.  
  325.   UINT fFlags;
  326.     SEARCH_CASE_INSENSITIVE    - the search is case insensitive
  327.     SEARCH_NO_REGEXP           - the pattern is not considered to be
  328.                                  a regular expression
  329.     SEARCH_PROMPT_ON_REPLACE   - prompts the user for each replacement
  330.     SEARCH_SELECTMATCH         - the matched text is highlighted and selected
  331.  
  332.   char szPattern[];    the ASCII search pattern, NULL terminated
  333.   char szReplace[];    the ASCII replacement pattern, NULL terminated
  334.  
  335.   The SEARCH_PROMPT_ON_REPLACE flag and szReplace[] string are only valid
  336.   in the Substitute command
  337.  
  338.   If lParam is NULL, then the editor will automatically bring up dialog
  339.   boxes for the search and substitute commands. This will allow you to
  340.   interactively enter the search and replace strings and the various
  341.   options.
  342.  
  343. Returns
  344.   TRUE if the pattern was found, FALSE if not.
  345.  
  346.  
  347. ME_SEARCHAGAIN     
  348.   Repeats the previous search operation.
  349. Parameters
  350.   wParam and lParam are not used
  351.  
  352. ME_REPLACEAGAIN
  353.   Repeats the previous replace operation.
  354. Parameters
  355.   wParam and lParam are not used
  356.  
  357. Returns
  358.   TRUE if the pattern was found, FALSE if not.
  359.  
  360.  
  361. ME_QUERYSEARCHSTRING
  362.   Retrieves the last string used for searching.
  363. Parameters
  364.   wParam is not used
  365.   lParam is the far pointer to a buffer which the search string will be copied
  366.     to. lParam can be NULL.
  367. Returns
  368.   The length of the search string, or 0 or there was no previous search
  369.   string.
  370.  
  371.  
  372.  
  373. Help
  374. ----
  375. ME_HELPONWORD
  376.   Gets help on the word under the cursor. The Windows help file used is
  377.   the one which is in the APIHELP entry in [options] section of the
  378.   MAGMAED.INI file.
  379. Parameters
  380.   wParam and lParam are not used
  381. Returns
  382.   TRUE if successful, FALSE if not.
  383.  
  384.  
  385. Selecting, cutting, copying and pasting text
  386. --------------------------------------------
  387. ME_APPENDLINE
  388.   Appends a blank line after the current line
  389. Parameters
  390.   wParam and lParam are not used
  391.  
  392. ME_CASELOWER
  393.   Changes the case of the selected text to all lower case
  394. Parameters
  395.   wParam and lParam are not used
  396.  
  397. ME_CASEUPPER
  398.   Changes the case of the selected text to all upper case
  399. Parameters
  400.   wParam and lParam are not used
  401.  
  402. ME_COPY
  403.   Copies the current selection, any marked lines, or the current line.
  404.   The copied text is placed into the clipboard.
  405.   If there is a currently marked selection, then this text is copied.
  406.   If there is no selected text, then the current line is copied.
  407.   The clipboard is cleared before the copied text is placed into it.
  408. Parameters
  409.   wParam and lParam are not used
  410.  
  411. ME_CUT
  412.   Deletes the current selection, any marked lines, or the current line.
  413.   The deleted text is placed into the clipboard.
  414.   If there is a currently marked selection, then this text is deleted.
  415.   If there is no selected text, then the current line is deleted.
  416.   The clipboard is cleared before the deleted text is placed into it.
  417. Parameters
  418.   wParam and lParam are not used
  419.  
  420. ME_CUTAPPEND
  421.   Deletes the current selection, any marked lines, or the current line.
  422.   The deleted text is placed into the clipboard.
  423.   If there is a currently marked selection, then this text is deleted.
  424.   If there is no selected text, then the current line is deleted.
  425.   The selected text is appended to the clipboard.
  426. Parameters
  427.   wParam and lParam are not used
  428.  
  429. ME_DELLINE
  430.   Deletes the current line or any marked lines. The deleted lines are
  431.   not placed into the clipboard.
  432. Parameters
  433.   wParam and lParam are not used
  434.  
  435. ME_DUPLINE
  436.   Duplicates the current line and inserts it after the current line.
  437. Parameters
  438.   wParam and lParam are not used
  439.  
  440. ME_INSERTLINE
  441.   Inserts a blank line before the current line
  442. Parameters
  443.   wParam and lParam are not used
  444.  
  445. ME_MARKLINE
  446.   Toggles the marked state of the current line.
  447. Parameters
  448.   wParam and lParam are not used
  449.  
  450. ME_MARKLINERANGE
  451.   Marks all lines from the current line up to the previously marked line.
  452.   The previously marked line must physically above the curent line.
  453. Parameters
  454.   wParam and lParam are not used
  455.  
  456. ME_PASTE
  457.   Inserts the contents of the pick buffer at the current position
  458. Parameters
  459.   wParam and lParam are not used
  460.  
  461. ME_RECTMARK
  462.   Starts or ends a 'column' selection. If this message is sent when there
  463.   are no selected areas of text, then the editor will 'mark' the
  464.   current cursor position. You can then move the cursor anywhere in the
  465.   buffer. When the second ME_STREAMMARK message is received by the
  466.   editor, it will select the columns of text between the starting and ending
  467.   selection points.
  468. Parameters
  469.   wParam and lParam are not used
  470.  
  471. ME_RESETMARK
  472.   Clears all selections from the current buffer. If any text is selected,
  473.   then it will become deselected.
  474. Parameters
  475.   wParam and lParam are not used
  476.  
  477. ME_STREAMMARK
  478.   Starts or ends a 'stream' selection. If this message is sent when there
  479.   are no selected areas of text, then the editor will 'mark' the
  480.   current cursor position. You can then move the cursor anywhere in the
  481.   buffer. When the second ME_STREAMMARK message is received by the
  482.   editor, it will select all text between the starting and ending
  483.   selection points.
  484. Parameters
  485.   wParam and lParam are not used
  486.  
  487. ME_TAB
  488. ME_BACKTAB
  489.   Indents the selected lines rightwards or leftwards. The ME_TAB command
  490.   pushes the text rightwards, and the ME_BACKTAB command pushes the text
  491.   leftwards.
  492. Parameters
  493.   wParam and lParam are not used
  494.  
  495.  
  496. Undo
  497. ----
  498. ME_REDO
  499.   Undoes the previous undo.
  500. Parameters
  501.   wParam and lParam are not used
  502.  
  503. ME_UNDO
  504.   Undoes the previous editing command.
  505. Parameters
  506.   wParam and lParam are not used
  507.  
  508.  
  509. Configuring the editor
  510. ----------------------
  511. ME_OPTIONDLG
  512.   Invokes the "Options" dialog box. This provides an interactive
  513.   way for the user to configure the editor.
  514. Parameters
  515.   wParam and lParam are not used
  516.  
  517. ME_SETOPTION
  518.   Sets a specific editor option.
  519. Parameters
  520.   wParam is the new value
  521.   lParam is a far pointer to the name of the option
  522.  
  523.  
  524. Name          Default   Meaning
  525. -----------   -------   -------
  526. AutoIndent    1         Are new lines auto-indented
  527. EntabLine     0         Lines are entabbed when written to a file
  528. GoFreeSpace   1         Can the cursor move into space beyond the end-of-line
  529. HighBitsOff   0         Editor masks out the high bit of characters
  530. IndentAmount  2         The amount of space each indent/undent command shifts
  531. InsertMode    1         The initial insert/overstrike mode  (1 = insert)
  532. RightMargin   80        The margin where wordwrapping will take effect
  533. TabFill       32        The fill character used for tabs
  534. TabIncrement  8         The width of a tab stop
  535. UndoEnabled   1         Undo enabled
  536. UseRealTabs   0         Use real tabs or insert spaces instead of tabs
  537. Wordwrap      0         Wordwrap enabled
  538.  
  539. ME_QUERYOPTION
  540.   Queries the current value of a specific editor option.
  541. Parameters
  542.   wParam is not used.
  543.   lParam is a far pointer to the name of the option
  544. Returns
  545.   The current value of the editor option.
  546.  
  547.  
  548. ME_SETTEXTCOLOR
  549.   Sets the color of the text.
  550. Parameters
  551.   wParam not used
  552.   lParam is the RGB color
  553.  
  554. ME_SETBKCOLOR
  555.   Sets the color of the editor window background.
  556. Parameters
  557.   wParam not used
  558.   lParam is the RGB color
  559.  
  560. EM_SETBKGNDCOLOR  (Chicago compatible)
  561.   Sets the color of the editor window background.
  562. Parameters
  563.   wParam is TRUE to use system color, FALSE for RGB value in lParam
  564.   lParam is the RGB value
  565. Returns
  566.   The old background color
  567.  
  568.  
  569.  
  570. Miscellaneous commands
  571. ----------------------
  572. ME_GETCURRWORD
  573.   Retrieves the word under the cursor and puts it in an app-passed buffer.
  574. Parameters
  575.   wParam is the length of the buffer
  576.   lParam is a far pointer to the buffer to copy the word into
  577. Returns
  578.   The length of the string if successful, 0 if not.
  579.  
  580.  
  581. ME_QUERYSTATUS
  582.   This message retrieved certain information about the editing buffer.
  583.   Information includes the current column, current line number, and the
  584.   total number of lines in the buffer.
  585. Parameters
  586.   wParam is not used.
  587.   lParam is a far pointer to an MAGMAED_STATUS structure.
  588. Returns
  589.   TRUE if the infomation was retrieved, FALSE if not.
  590.  
  591. Keyboard Macros
  592. ---------------
  593. ME_KEYMACDEFINE
  594.   Starts and stops the recording of a keyboard macro. To begin recording
  595.   a keyboard macro, send the ME_KEYMACDEFINE message to the editor. To
  596.   stop the recording, send this message again.
  597. Parameters
  598.   wParam and lParam are not used
  599.  
  600. ME_KEYMACPLAY
  601.   Plays the currently-defined keyboard macro
  602. Parameters
  603.   wParam and lParam are not used
  604.  
  605.  
  606. Notification messages
  607. ---------------------
  608. MEN_UPDATE
  609.   This notification code is sent when the state of the editor has changed.
  610.   A WM_COMMAND message will be sent to the window which is the parent of
  611.   the editor window. The wParam will be the control ID of the editor
  612.   window, the LOWORD of the lParam will be the window handle of the
  613.   editor window, and the HIWORD of the lParam will be the MEN_UPDATE
  614.   code.
  615.  
  616.   A typical use for this message is to update the "editor decorations"
  617.   in your application when something in the editor has changed. For
  618.   example, if your application maintains a status line for the
  619.   editor, then you can use the following code in your application
  620.   in order to update the status line:
  621.  
  622.     case WM_COMMAND:
  623.       if (HIWORD(lParam) == MEN_UPDATE)
  624.       {
  625.         InvalidateRect(hWndStatus, (LPRECT) NULL, FALSE);
  626.         break;
  627.       }
  628.  
  629.  
  630. Windows/API Messages Supported
  631. ------------------------------
  632. The following messages are provided for compatibility with the
  633. standard Windows edit control.
  634.  
  635.  
  636. WM_GETTEXT
  637.   Retrieves the contents of the edit control and puts the text into the
  638.   passed memory location.
  639. Parameters
  640.   wParam is the maximum size of the text to be copied.
  641.   Note:
  642.     A limitation is that wParam contains the max length of the buffer,
  643.     which under 16-bit Windows, can be at most 64K. So, we will add
  644.     a little extension here. If wParam is 0, then we will not check
  645.     the length of the buffer.
  646.   lParam is a far pointer to the memory location which will receive the
  647.     text.
  648. Returns
  649.   The number of bytes copied into the memory location, or 0 if not
  650.   successful.
  651.  
  652. WM_GETTEXTLENGTH
  653.   Queries the length of the text in the edit control.
  654. Parameters
  655.   wParam and lParam are not used.
  656. Returns
  657.   The number of characters in the edit control. This double-word value
  658.   can be greater than 64K.
  659.  
  660. WM_SETTEXT
  661.   Sets the contents of the edit control to the specified text.
  662. Parameters
  663.   wParam is not used.
  664.   lParam is a far pointer to the text to set.
  665. Returns
  666.   TRUE if successful, FALSE if not.
  667.  
  668.  
  669. EM_GETFIRSTVISIBLELINE
  670.   Queries the line number of the line which is at the top of the
  671.   editor window.
  672. Parameters
  673.   wParam is not used.
  674.   lParam is not used.
  675. Returns
  676.   The 0-based line number of the line at the top of the window.
  677.  
  678. EM_GETLINE
  679.   Retrieves the contents of a specified line.
  680. Parameters
  681.   wParam is the 0-based line number of the line to query.
  682.   lParam is a far pointer to a memory location where the contents
  683.     of the line will be copied to.
  684. Returns
  685.   The number of bytes copied.
  686.  
  687. EM_GETLINECOUNT
  688.   Queries the number of lines in the edit control.
  689. Parameters
  690.   wParam is not used.
  691.   lParam is not used.
  692. Returns
  693.   The number of lines in the editor.
  694.  
  695. EM_GETSELTEXT  (Chicago compatible)
  696.   This message retrieves the text which is currently selected.
  697. Parameters
  698.   wParam is 0
  699.   lParam is a far pointer to a buffer which the text will be placed into.
  700. Returns
  701.   TRUE if there was selected text, FALSE if not.
  702. Notes
  703.   The editor does not check the length of the the buffer pointed to by
  704.   lParam. It is up to the application to ensure that the buffer is large
  705.   enough to hold the selected text.
  706.  
  707.  
  708. EM_LINEFROMCHAR
  709.   Given a 0-based index into the editor, returns the line number of
  710.   the line which contains the character.
  711. Parameters
  712.   wParam contains the 0-based index of the character.
  713.   Note :
  714.     A limitation is that wParam contains the max length of the buffer,
  715.     which under 16-bit Windows, can be at most 64K. So, we will add
  716.     a little extension here. If lParam is not 0, then we will use the
  717.     value in lParam as the index.
  718.   lParam must be 0 if you are using wParam as the index. Otherwise,
  719.     lParam will be used as the index.
  720. Returns
  721.   The 0-based line number.
  722.  
  723. EM_EXLINEFROMCHAR  (Chicago compatible)
  724.   See the EM_LINEFROMCHAR message.
  725. Parameters
  726.   wParam is 0
  727.   lParam is the index
  728.  
  729. EM_LINEINDEX
  730.   Given the number of a line, returns the 0-based index of the first
  731.   character on that line.
  732. Parameters
  733.   wParam is the 0-based line number. If lParam is not 0, then lParam is
  734.     used as the line number.
  735.   lParam should be 0 if you are using wParam to hold the line number.
  736.     Otherwise, lParam can hold the line number.
  737. Returns
  738.   The 0-based index of the first character on the line. If wParam contains
  739.   a line number which is greater than the number of lines in the edit
  740.   control, then -1 is returned.
  741.  
  742. EM_LINELENGTH
  743.   Queries the number of characters in a certain line.
  744. Parameters
  745.   wParam is the 0-based line number. If lParam is not 0, then lParam
  746.     holds the line number.
  747.   lParam should be 0 if wParam holds the line number. Otherwise, the
  748.     value in lParam will be used as the line number.
  749. Returns
  750.   The number of characters in the line, or 0 if the line number
  751.   does not exist.
  752.  
  753. EM_GETMODIFY
  754.   Queries the modification state of the edit control.
  755. Parameters
  756.   wParam is not used.
  757.   lParam is not used.
  758. Returns
  759.   Non-zero if the edit control has been modified, 0 if not.
  760.  
  761. EM_SETMODIFY
  762.   Sets the modification state of the edit control.
  763. Parameters
  764.   wParam is the new modification state. It should be non-zero if the
  765.     edit control should be considered to have been modified, and zero
  766.     if you want to clear the modification state.
  767.   lParam is not used.
  768. Returns
  769.   The new modification state.
  770.  
  771. EM_GETSEL
  772.   Queries the current selection points.
  773. Parameters
  774.   wParam and lParam are not used.
  775. Returns
  776.   If an area of text has been selected, then the low word of the return
  777.   value is the starting index of the selection and the high word of
  778.   the return value is the index of the last selected character plus 1.
  779.   If an area is not selected, then both the low word and high word of the
  780.   return value contain the index where the cursor is currently positioned.
  781.  
  782. EM_REPLACESEL
  783.   Replaces the selected text with another string.
  784. Parameters
  785.   wParam is not used.
  786.   lParam is a far pointer to a string to use to replace the selected text
  787.   with.  
  788.  
  789. EM_SETSEL
  790.   Sets the current selection points. Each selection point must be an index
  791.   less than 64K. See the EM_EXSETSEL message if you need to select an
  792.   area in a buffer which contains more than 64K of text.
  793. Parameters
  794.   wParam is 0.
  795.   The low word of lParam is the index of the starting point of the
  796.   selected area. The high word of lParam is the index of the first
  797.   character after the starting selection index which is not selected.
  798.  
  799.  
  800. EM_EXGETSEL  (Chicago compatible)
  801.   Queries the current selection points. Each selection point can be
  802.   a number greater than 64K.
  803. Parameters
  804.   wParam is 0
  805.   lParam is a far pointer to a CHARRANGE structure
  806.  
  807. EM_EXSETSEL  (Chicago compatible)
  808.   Sets the current selection points. Each selection point can be
  809.   a number greater than 64K.
  810. Parameters
  811.   wParam is 0
  812.   lParam is a far pointer to a CHARRANGE structure
  813.  
  814.  
  815. EM_SETREADONLY
  816.   Modifies the 'read-only' state of the edit control.
  817. Parameters
  818.   wParam is non-zero if the read-only state should be set, and zero
  819.     if it should be cleared.
  820.   lParam is not used.
  821. Returns
  822.    TRUE if successful, FALSE if not.
  823.  
  824. EM_SETTABSTOPS
  825.   Sets the tab stops of the edit control.
  826. Parameters
  827.   wParam specifies the number of tab stops contained in the lpTabs array
  828.     pointed to by lParam. If wParam is 1, then the lpTabs[0] contains
  829.     tab increment multiplied by 4; the tabs will be set every
  830.     'lpTabs[0]/4' number of columns. If wParam is 0, then the default tab 
  831.     settings are used. If wParam is greater than 1, then lpTabs is an array 
  832.     of tab stops.
  833.  
  834.   lParam is a far pointer to an array of tab stops. Each tab stop
  835.     represents a column number multiplied by 4. The value 4 is equivalent
  836.     to the Windows dialog unit.
  837. Returns
  838.   TRUE if the tabs were set, FALSE if not.
  839.  
  840. Notification Messages
  841. ---------------------
  842. EN_CHANGE     the contents of the edit control have been altered
  843. EN_HSCROLL    the edit control's horizontal scrollbar has been clicked on
  844. EN_KILLFOCUS  the edit control is losing the focus
  845. EN_SETFOCUS   the edit control has gained the focus
  846. EN_VSCROLL    the edit control's horizontal scrollbar has been clicked on
  847. MEM_UPDATE    the editing status has changed. This message is usually
  848.               used to determine when the status line should be refreshed.
  849.  
  850.